<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: BasePhyLayer Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00029.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pro-static-attribs">Static Protected Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">BasePhyLayer Class Reference<div class="ingroups"><a class="el" href="a00510.html">phyLayer - physical layer modules</a> &#124; <a class="el" href="a00516.html">baseModules - base module classes of MiXiM</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="BasePhyLayer" --><!-- doxytag: inherits="ConnectionManagerAccess,DeciderToPhyInterface,MacToPhyInterface" -->
<p>The <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> represents the physical layer of a nic.  
 <a href="a00029.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00285_source.html">BasePhyLayer.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for BasePhyLayer:</div>
<div class="dyncontent">
<div class="center"><img src="a00599.png" border="0" usemap="#BasePhyLayer_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for BasePhyLayer:</div>
<div class="dyncontent">
<div class="center"><img src="a00600.png" border="0" usemap="#BasePhyLayer_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00601.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a0fc69907490ed2752d2a888ef26348ff">~BasePhyLayer</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae32062e99cf8196496491bb6800ed3d5"></a><!-- doxytag: member="BasePhyLayer::finish" ref="ae32062e99cf8196496491bb6800ed3d5" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#ae32062e99cf8196496491bb6800ed3d5">finish</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Only calls the deciders finish method. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual cObject *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#af629dfbac6c68d0310ed91a7520c7ab2">setUpControlInfo</a> (cMessage *const pMsg, <a class="el" href="a00075.html">DeciderResult</a> *const pDeciderResult)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attaches a "control info" (PhyToMac) structure (object) to the message pMsg.  <a href="#af629dfbac6c68d0310ed91a7520c7ab2"></a><br/></td></tr>
<tr><td colspan="2"><div class="groupHeader">MacToPhyInterface implementation</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>These methods implement the <a class="el" href="a00134.html" title="Defines the methods provided by the phy to the mac layer.">MacToPhyInterface</a>. </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a893db61c894236b50c4c56e569ceedbb">getRadioState</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current state the radio is in.  <a href="#a893db61c894236b50c4c56e569ceedbb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a36f7f3be7d32aa1818c0f31057478e80"></a><!-- doxytag: member="BasePhyLayer::isRadioInRX" ref="a36f7f3be7d32aa1818c0f31057478e80" args="() const " -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a36f7f3be7d32aa1818c0f31057478e80">isRadioInRX</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the true if the radio is in RX state. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual simtime_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a5170b3aadae25dc6b9e61974076be04b">setRadioState</a> (int rs)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tells the <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> to switch to the specified radio state.  <a href="#a5170b3aadae25dc6b9e61974076be04b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00044.html">ChannelState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a8cc235ebda1b8ff6dcf17b6b0b91fc13">getChannelState</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current state of the channel.  <a href="#a8cc235ebda1b8ff6dcf17b6b0b91fc13"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#acb8478eaf566b68e949e6d16cea0e22a">getPhyHeaderLength</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the length of the phy header in bits.  <a href="#acb8478eaf566b68e949e6d16cea0e22a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa662c2194a72e2c46f6b25e7e6901834"></a><!-- doxytag: member="BasePhyLayer::setCurrentRadioChannel" ref="aa662c2194a72e2c46f6b25e7e6901834" args="(int newRadioChannel)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aa662c2194a72e2c46f6b25e7e6901834">setCurrentRadioChannel</a> (int newRadioChannel)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the channel currently used by the radio. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a78d08dafa6b53482145a7fe6adf30648"></a><!-- doxytag: member="BasePhyLayer::getCurrentRadioChannel" ref="a78d08dafa6b53482145a7fe6adf30648" args="() const " -->
virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a78d08dafa6b53482145a7fe6adf30648">getCurrentRadioChannel</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the channel currently used by the radio. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a30f5f83644568e1be77cc25ea74aaf8b"></a><!-- doxytag: member="BasePhyLayer::getNbRadioChannels" ref="a30f5f83644568e1be77cc25ea74aaf8b" args="() const " -->
virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a30f5f83644568e1be77cc25ea74aaf8b">getNbRadioChannels</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of channels available on this radio. <br/></td></tr>
<tr><td colspan="2"><div class="groupHeader">DeciderToPhyInterface implementation</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>These methods implement the <a class="el" href="a00079.html" title="This class is the interface for a Decider to the BasePhyLayer.">DeciderToPhyInterface</a>. </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af47d1c1771648303c64aa1da77cba2e4"></a><!-- doxytag: member="BasePhyLayer::getChannelInfo" ref="af47d1c1771648303c64aa1da77cba2e4" args="(simtime_t_cref from, simtime_t_cref to, AirFrameVector &amp;out) const " -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#af47d1c1771648303c64aa1da77cba2e4">getChannelInfo</a> (simtime_t_cref from, simtime_t_cref to, <a class="el" href="a00079.html#a13e15d0d80017e55821963b3b4a6cf55">AirFrameVector</a> &amp;out) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills the passed AirFrameVector with all AirFrames that intersect with the time interval [from, to]. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00058.html">ConstMapping</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a42664d512b88bedf58b5d21adc180984">getThermalNoise</a> (simtime_t_cref from, simtime_t_cref to)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a <a class="el" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a> which defines the thermal noise in the passed time frame (in mW).  <a href="#a42664d512b88bedf58b5d21adc180984"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a76d0386516d18d1cc64af5ef6fb315cd">sendControlMsgToMac</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Called by the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> to send a control message to the MACLayer.  <a href="#a76d0386516d18d1cc64af5ef6fb315cd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aa255e2b0181c204d4a8d06075967ef10">sendUp</a> (airframe_ptr_t packet, <a class="el" href="a00075.html">DeciderResult</a> *result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Called to send an AirFrame with <a class="el" href="a00075.html" title="A class to represent the result of a processed packet (that is not noise) by the Decider.">DeciderResult</a> to the MACLayer.  <a href="#aa255e2b0181c204d4a8d06075967ef10"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a45584e776ce714bcb30232bd4ace850c"></a><!-- doxytag: member="BasePhyLayer::getSimTime" ref="a45584e776ce714bcb30232bd4ace850c" args="() const " -->
virtual simtime_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a45584e776ce714bcb30232bd4ace850c">getSimTime</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current simulation time. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aa4c75db0828cf579907b1e9a9c683e99">cancelScheduledMessage</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tells the <a class="el" href="a00173.html" title="Provides initialisation for several AnalogueModels and Deciders from modules directory.">PhyLayer</a> to cancel a scheduled message (AirFrame or ControlMessage).  <a href="#aa4c75db0828cf579907b1e9a9c683e99"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#ac012473c1be0df5df5f901ad1a3e890e">rescheduleMessage</a> (cMessage *msg, simtime_t_cref t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tells the <a class="el" href="a00173.html" title="Provides initialisation for several AnalogueModels and Deciders from modules directory.">PhyLayer</a> to reschedule a message (AirFrame or ControlMessage).  <a href="#ac012473c1be0df5df5f901ad1a3e890e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a81153199f268b4831f42b20b06959764"></a><!-- doxytag: member="BasePhyLayer::drawCurrent" ref="a81153199f268b4831f42b20b06959764" args="(double amount, int activity)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a81153199f268b4831f42b20b06959764">drawCurrent</a> (double amount, int activity)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Does nothing. For an actual power supporting phy see "PhyLayerBattery". <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a4be8fe4abf2c9705625f93114aa6d337">recordScalar</a> (const char *name, double value, const char *unit=NULL)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Records a double into the scalar result file.  <a href="#a4be8fe4abf2c9705625f93114aa6d337"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><b>ProtocolIds</b> { <b>GENERIC</b> =  0
 }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a4cd91821a30270d51c4c66594b9d7122">eAirFrameStates</a> { <a class="el" href="a00029.html#a4cd91821a30270d51c4c66594b9d7122aa0cb17278ea70e7e327de30aad32e0a0">START_RECEIVE</a> =  1, 
<a class="el" href="a00029.html#a4cd91821a30270d51c4c66594b9d7122a2900d4f5f03ec09b83e5c24744924755">RECEIVING</a>, 
<a class="el" href="a00029.html#a4cd91821a30270d51c4c66594b9d7122a8c8f8a59dc873e035f19750598ceb157">END_RECEIVE</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The states of the receiving process for AirFrames.  <a href="a00029.html#a4cd91821a30270d51c4c66594b9d7122">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac8dca20c727bdb1494d97da1c64bb55d"></a><!-- doxytag: member="BasePhyLayer::AnalogueModelList" ref="ac8dca20c727bdb1494d97da1c64bb55d" args="" -->
typedef std::vector<br class="typebreak"/>
&lt; <a class="el" href="a00009.html">AnalogueModel</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#ac8dca20c727bdb1494d97da1c64bb55d">AnalogueModelList</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Used to store the AnalogueModels to be used as filters. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class T &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46">readPar</a> (const char *parName, const T defaultValue) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads and returns the parameter with the passed name.  <a href="#acb6faccca49fc7d6f8604ee7f29b4c46"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a08704deaf03b73c8eda67cc60e670853">initialize</a> (int stage)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">OMNeT++ initialization function.  <a href="#a08704deaf03b73c8eda67cc60e670853"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a3880154c8db8b8efb5315cb6ef8f6c41">handleMessage</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">OMNeT++ handle message function.  <a href="#a3880154c8db8b8efb5315cb6ef8f6c41"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00141.html">MiximRadio</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aad75440994998cc89ef7028528197cb7">initializeRadio</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes and returns the radio class to use.  <a href="#aad75440994998cc89ef7028528197cb7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00009.html">AnalogueModel</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#af578e3fbeacc12b639dd5f072215bac5">getAnalogueModelFromName</a> (const std::string &amp;name, <a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;params) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates and returns an instance of the <a class="el" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a> with the specified name.  <a href="#af578e3fbeacc12b639dd5f072215bac5"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class _AMODEL_CLASS_ &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">_AMODEL_CLASS_ *&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00029.html#a1e4dd47185d6931380f459c62200faee">createAnalogueModel</a> (const <a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;params) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates and returns an instance of the analogue model with the specified _AMODEL_CLASS_.  <a href="#a1e4dd47185d6931380f459c62200faee"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00070.html">Decider</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a7d18a0853db85eba39f370e51ae8b007">getDeciderFromName</a> (const std::string &amp;name, <a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;params)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates and returns an instance of the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> with the specified name.  <a href="#a7d18a0853db85eba39f370e51ae8b007"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class _DECIDER_CLASS_ &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">_DECIDER_CLASS_ *&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00029.html#a5aa60c2caec2dad44aca154e0710a7e4">createDecider</a> (const <a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;params)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates and returns an instance of the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> with the specified _DECIDER_CLASS_.  <a href="#a5aa60c2caec2dad44aca154e0710a7e4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9e03a4078cc2d1c4214249120901321c"></a><!-- doxytag: member="BasePhyLayer::encapsMsg" ref="a9e03a4078cc2d1c4214249120901321c" args="(cPacket *msg)" -->
virtual airframe_ptr_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a9e03a4078cc2d1c4214249120901321c">encapsMsg</a> (cPacket *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This function encapsulates messages from the upper layer into an AirFrame and sets all necessary attributes. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aadce19c8b5e2737ab4fb0d53184ccecf">filterSignal</a> (airframe_ptr_t frame)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Filters the passed AirFrame's <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a> by every registered <a class="el" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a>.  <a href="#aadce19c8b5e2737ab4fb0d53184ccecf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aa1de743a3d3ba652c1f3b84b34585743">finishRadioSwitching</a> (bool bSendCtrlMsg=true)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Called the moment the simulated switching process of the <a class="el" href="a00141.html" title="The class that represents the Radio as a state machine.">MiximRadio</a> is finished.  <a href="#aa1de743a3d3ba652c1f3b84b34585743"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#adecf85d8636ac48e1ce8cea176a3c71c">myProtocolId</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the identifier of the protocol this phy uses to send messages.  <a href="#adecf85d8636ac48e1ce8cea176a3c71c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a618479a7b36d43594ab3e8a7d80007bb">isKnownProtocolId</a> (int id) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the protocol with the passed identifier is decodeable by the decider.  <a href="#a618479a7b36d43594ab3e8a7d80007bb"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2"><a class="anchor" id="a3ceb75519538a55431f4f63702529445"></a><!-- doxytag: member="BasePhyLayer::readPar" ref="a3ceb75519538a55431f4f63702529445" args="(const char *parName, const simtime_t defaultValue) const " -->
template&lt;&gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">simtime_t&#160;</td><td class="memTemplItemRight" valign="bottom"><b>readPar</b> (const char *parName, const simtime_t defaultValue) const </td></tr>
<tr><td colspan="2"><div class="groupHeader">Handle Messages</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac8e87dac89d0c0daa01a8d430be7e7b6"></a><!-- doxytag: member="BasePhyLayer::handleAirFrame" ref="ac8e87dac89d0c0daa01a8d430be7e7b6" args="(airframe_ptr_t frame)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#ac8e87dac89d0c0daa01a8d430be7e7b6">handleAirFrame</a> (airframe_ptr_t frame)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles messages received from the channel (probably AirFrames). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a17b1d469775962d23835dd5f43a639ac"></a><!-- doxytag: member="BasePhyLayer::handleUpperMessage" ref="a17b1d469775962d23835dd5f43a639ac" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a17b1d469775962d23835dd5f43a639ac">handleUpperMessage</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles messages received from the upper layer through the data gate. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4cab267d310b5fd6cefe613fc8dfe71d"></a><!-- doxytag: member="BasePhyLayer::handleUpperControlMessage" ref="a4cab267d310b5fd6cefe613fc8dfe71d" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a4cab267d310b5fd6cefe613fc8dfe71d">handleUpperControlMessage</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles messages received from the upper layer through the control gate. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a17088ad93f59e143ff6c7ba866a31982"></a><!-- doxytag: member="BasePhyLayer::handleSelfMessage" ref="a17088ad93f59e143ff6c7ba866a31982" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a17088ad93f59e143ff6c7ba866a31982">handleSelfMessage</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles self scheduled messages. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6866e3f79df84cdb5550a51d6502463f"></a><!-- doxytag: member="BasePhyLayer::handleChannelSenseRequest" ref="a6866e3f79df84cdb5550a51d6502463f" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a6866e3f79df84cdb5550a51d6502463f">handleChannelSenseRequest</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles reception of a ChannelSenseRequest by forwarding it to the decider and scheduling it to the point in time returned by the decider. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6062d98a2df1275c6ef008facfd8c0af"></a><!-- doxytag: member="BasePhyLayer::handleAirFrameFirstReceive" ref="a6062d98a2df1275c6ef008facfd8c0af" args="(airframe_ptr_t msg)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a6062d98a2df1275c6ef008facfd8c0af">handleAirFrameFirstReceive</a> (airframe_ptr_t msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles incoming AirFrames with the state FIRST_RECEIVE. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af21aac7c5a0c4bc282817232f3879611"></a><!-- doxytag: member="BasePhyLayer::handleAirFrameStartReceive" ref="af21aac7c5a0c4bc282817232f3879611" args="(airframe_ptr_t msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#af21aac7c5a0c4bc282817232f3879611">handleAirFrameStartReceive</a> (airframe_ptr_t msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles incoming AirFrames with the state START_RECEIVE. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a500cbd8d17f36299121b01a103667cd5"></a><!-- doxytag: member="BasePhyLayer::handleAirFrameReceiving" ref="a500cbd8d17f36299121b01a103667cd5" args="(airframe_ptr_t msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a500cbd8d17f36299121b01a103667cd5">handleAirFrameReceiving</a> (airframe_ptr_t msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles incoming AirFrames with the state RECEIVING. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a415f92b23835dc5ffc568747a4669b8f"></a><!-- doxytag: member="BasePhyLayer::handleAirFrameEndReceive" ref="a415f92b23835dc5ffc568747a4669b8f" args="(airframe_ptr_t msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a415f92b23835dc5ffc568747a4669b8f">handleAirFrameEndReceive</a> (airframe_ptr_t msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles incoming AirFrames with the state END_RECEIVE. <br/></td></tr>
<tr><td colspan="2"><div class="groupHeader">Send Messages</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa439e85a8bc20a39477055aecf04993"></a><!-- doxytag: member="BasePhyLayer::sendControlMessageUp" ref="aaa439e85a8bc20a39477055aecf04993" args="(cMessage *msg)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aaa439e85a8bc20a39477055aecf04993">sendControlMessageUp</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends the passed control message to the upper layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af5ac9665c3f3eaee7846ef0ba141b858"></a><!-- doxytag: member="BasePhyLayer::sendMacPktUp" ref="af5ac9665c3f3eaee7846ef0ba141b858" args="(cMessage *pkt)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#af5ac9665c3f3eaee7846ef0ba141b858">sendMacPktUp</a> (cMessage *pkt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends the passed MacPkt to the upper layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaf9ded47fad2c0930aee595b9ec16770"></a><!-- doxytag: member="BasePhyLayer::sendMessageDown" ref="aaf9ded47fad2c0930aee595b9ec16770" args="(airframe_ptr_t pkt)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aaf9ded47fad2c0930aee595b9ec16770">sendMessageDown</a> (airframe_ptr_t pkt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends the passed AirFrame to the channel. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa59aef501cadd36c94d4f82efe9b64be"></a><!-- doxytag: member="BasePhyLayer::sendSelfMessage" ref="aa59aef501cadd36c94d4f82efe9b64be" args="(cMessage *msg, simtime_t_cref time)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aa59aef501cadd36c94d4f82efe9b64be">sendSelfMessage</a> (cMessage *msg, simtime_t_cref time)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Schedule self message to passed point in time. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="addc3dfa9056f0acafefacd34d5d059bf"></a><!-- doxytag: member="BasePhyLayer::protocolId" ref="addc3dfa9056f0acafefacd34d5d059bf" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>protocolId</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afedc2cd6f80601fb040b56256e6cc756"></a><!-- doxytag: member="BasePhyLayer::thermalNoise" ref="afedc2cd6f80601fb040b56256e6cc756" args="" -->
<a class="el" href="a00055.html">ConstantSimpleConstMapping</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756">thermalNoise</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Defines the strength of the thermal noise. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a80fe7028b2fbf92f61dd30b79e30a86d"></a><!-- doxytag: member="BasePhyLayer::maxTXPower" ref="a80fe7028b2fbf92f61dd30b79e30a86d" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a80fe7028b2fbf92f61dd30b79e30a86d">maxTXPower</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The maximum transmission power a message can be send with. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7eaa041636b623066b5abd87a38afa25"></a><!-- doxytag: member="BasePhyLayer::sensitivity" ref="a7eaa041636b623066b5abd87a38afa25" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a7eaa041636b623066b5abd87a38afa25">sensitivity</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The sensitivity describes the minimum strength a signal must have to be received. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a71f6c8e91a8f597a5d213b30c64b0cf8"></a><!-- doxytag: member="BasePhyLayer::recordStats" ref="a71f6c8e91a8f597a5d213b30c64b0cf8" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a71f6c8e91a8f597a5d213b30c64b0cf8">recordStats</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores if tracking of statistics (esp. cOutvectors) is enabled. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a38d35bc99079eff49deb6c870b1175e7"></a><!-- doxytag: member="BasePhyLayer::channelInfo" ref="a38d35bc99079eff49deb6c870b1175e7" args="" -->
<a class="el" href="a00043.html">ChannelInfo</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a38d35bc99079eff49deb6c870b1175e7">channelInfo</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Channel info keeps track of received AirFrames and provides information about currently active AirFrames at the channel. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab2a4c85442ff2436ca7fbe6c424c1b2c"></a><!-- doxytag: member="BasePhyLayer::radio" ref="ab2a4c85442ff2436ca7fbe6c424c1b2c" args="" -->
<a class="el" href="a00141.html">MiximRadio</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c">radio</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The state machine storing the current radio state (TX, RX, SLEEP). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5be00b3a133596d8ed78a9f8e38973d4"></a><!-- doxytag: member="BasePhyLayer::decider" ref="a5be00b3a133596d8ed78a9f8e38973d4" args="" -->
<a class="el" href="a00070.html">Decider</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a5be00b3a133596d8ed78a9f8e38973d4">decider</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to the decider module. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abc00fc5777ef641f72b5a4d85bf65c93"></a><!-- doxytag: member="BasePhyLayer::analogueModels" ref="abc00fc5777ef641f72b5a4d85bf65c93" args="" -->
<a class="el" href="a00029.html#ac8dca20c727bdb1494d97da1c64bb55d">AnalogueModelList</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#abc00fc5777ef641f72b5a4d85bf65c93">analogueModels</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List of the analogue models to use. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a49fcd06f6c27aab1d14d13eaecc09f1b"></a><!-- doxytag: member="BasePhyLayer::upperLayerIn" ref="a49fcd06f6c27aab1d14d13eaecc09f1b" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a49fcd06f6c27aab1d14d13eaecc09f1b">upperLayerIn</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The id of the in-data gate from the Mac layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a334fbbb0a1608058c46906ef2c90045f"></a><!-- doxytag: member="BasePhyLayer::upperLayerOut" ref="a334fbbb0a1608058c46906ef2c90045f" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a334fbbb0a1608058c46906ef2c90045f">upperLayerOut</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The id of the out-data gate to the Mac layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aca9b66970dd836cc696dd0907c58598b"></a><!-- doxytag: member="BasePhyLayer::upperControlOut" ref="aca9b66970dd836cc696dd0907c58598b" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#aca9b66970dd836cc696dd0907c58598b">upperControlOut</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The id of the out-control gate to the Mac layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab58c7430371f1ba135e0a641d150c1e3"></a><!-- doxytag: member="BasePhyLayer::upperControlIn" ref="ab58c7430371f1ba135e0a641d150c1e3" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#ab58c7430371f1ba135e0a641d150c1e3">upperControlIn</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The id of the in-control gate from the Mac layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac28de586b21162c377a180233299a1d5"></a><!-- doxytag: member="BasePhyLayer::radioSwitchingOverTimer" ref="ac28de586b21162c377a180233299a1d5" args="" -->
cMessage *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#ac28de586b21162c377a180233299a1d5">radioSwitchingOverTimer</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Self message scheduled to the point in time when the switching process of the radio is over. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2ce22bc20ab469e99352958face5468d"></a><!-- doxytag: member="BasePhyLayer::txOverTimer" ref="a2ce22bc20ab469e99352958face5468d" args="" -->
cMessage *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a2ce22bc20ab469e99352958face5468d">txOverTimer</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Self message scheduled to the point in time when the transmission of an AirFrame is over. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a75255fe80f09f87b7db213d21db3b8e8"></a><!-- doxytag: member="BasePhyLayer::headerLength" ref="a75255fe80f09f87b7db213d21db3b8e8" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a75255fe80f09f87b7db213d21db3b8e8">headerLength</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores the length of the phy header in bits. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad1de573273df163a5fc2b8b537c65e23"></a><!-- doxytag: member="BasePhyLayer::world" ref="ad1de573273df163a5fc2b8b537c65e23" args="" -->
<a class="el" href="a00030.html">BaseWorldUtility</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#ad1de573273df163a5fc2b8b537c65e23">world</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to the World Utility, to obtain some global information. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-static-attribs"></a>
Static Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#ac68a290868512c992f8a49b6af7b6c7c">airFramePriority</a> = 10</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Defines the scheduling priority of AirFrames.  <a href="#ac68a290868512c992f8a49b6af7b6c7c"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7582bacd4cd232ebf9eeaee6ec473a64"></a><!-- doxytag: member="BasePhyLayer::getParametersFromXML" ref="a7582bacd4cd232ebf9eeaee6ec473a64" args="(cXMLElement *xmlData, ParameterMap &amp;outputMap) const " -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a7582bacd4cd232ebf9eeaee6ec473a64">getParametersFromXML</a> (cXMLElement *xmlData, <a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;outputMap) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function. Reads the parameters of a XML element and stores them in the passed ParameterMap reference. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8ea7353793eed2f1a7b0cd1caacd72e9"></a><!-- doxytag: member="BasePhyLayer::initializeAnalogueModels" ref="a8ea7353793eed2f1a7b0cd1caacd72e9" args="(cXMLElement *xmlConfig)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a8ea7353793eed2f1a7b0cd1caacd72e9">initializeAnalogueModels</a> (cXMLElement *xmlConfig)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the AnalogueModels with the data from the passed XML-config data. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9da4f8ffaa373a0de7895cbea524816b"></a><!-- doxytag: member="BasePhyLayer::initializeDecider" ref="a9da4f8ffaa373a0de7895cbea524816b" args="(cXMLElement *xmlConfig)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a9da4f8ffaa373a0de7895cbea524816b">initializeDecider</a> (cXMLElement *xmlConfig)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> with the data from the passed XML-config data. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6dd46cf3eb4cac8e6fe56a4f17cf8f55"></a><!-- doxytag: member="BasePhyLayer::BasePhyLayer" ref="a6dd46cf3eb4cac8e6fe56a4f17cf8f55" args="(const BasePhyLayer &amp;)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a6dd46cf3eb4cac8e6fe56a4f17cf8f55">BasePhyLayer</a> (const <a class="el" href="a00029.html">BasePhyLayer</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor is not allowed. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7dc17265602d237a6981845df223fa54"></a><!-- doxytag: member="BasePhyLayer::operator=" ref="a7dc17265602d237a6981845df223fa54" args="(const BasePhyLayer &amp;)" -->
<a class="el" href="a00029.html">BasePhyLayer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00029.html#a7dc17265602d237a6981845df223fa54">operator=</a> (const <a class="el" href="a00029.html">BasePhyLayer</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator is not allowed. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> represents the physical layer of a nic. </p>
<p>The <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> is directly connected to the mac layer via OMNeT channels and is able to send messages to other physical layers through sub-classing from ChannelAcces.</p>
<p>The <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> encapsulates two sub modules. The AnalogueModels, which are responsible for simulating the attenuation of received signals and the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> which provides the main functionality of the physical layer like signal classification (noise or not noise) and demodulation (calculating transmission errors).</p>
<p>The <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> itself is responsible for the OMNeT depended parts of the physical layer which are the following:</p>
<p>Module initialization:</p>
<ul>
<li>read ned-parameters and initialize module, <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> and AnalogueModels.</li>
</ul>
<p>Message handling:</p>
<ul>
<li>receive messages from mac layer and hand them to the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> or directly send them to the channel</li>
<li>receive AirFrames from the channel, hand them to the AnalogueModels for filtering, simulate delay and transmission duration, hand it to the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> for evaluation and send received packets to the mac layer</li>
<li>keep track of currently active AirFrames on the channel (see <a class="el" href="a00043.html" title="This class is used by the BasePhyLayer to keep track of the AirFrames on the channel.">ChannelInfo</a>)</li>
</ul>
<p>The actual evaluation of incoming signals is done by the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a>.</p>
<p>base class <a class="el" href="a00053.html" title="Basic class for all physical layers, please don&#39;t touch!!">ConnectionManagerAccess</a>:</p>
<ul>
<li>provides access to the channel via the <a class="el" href="a00052.html" title="BaseConnectionManager implementation which only defines a specific max interference distance...">ConnectionManager</a></li>
</ul>
<p>base class <a class="el" href="a00079.html" title="This class is the interface for a Decider to the BasePhyLayer.">DeciderToPhyInterface</a>:</p>
<ul>
<li>interface for the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a></li>
</ul>
<p>base class <a class="el" href="a00134.html" title="Defines the methods provided by the phy to the mac layer.">MacToPhyInterface</a>:</p>
<ul>
<li>interface for the Mac </li>
</ul>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="a4cd91821a30270d51c4c66594b9d7122"></a><!-- doxytag: member="BasePhyLayer::eAirFrameStates" ref="a4cd91821a30270d51c4c66594b9d7122" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00029.html#a4cd91821a30270d51c4c66594b9d7122">BasePhyLayer::eAirFrameStates</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The states of the receiving process for AirFrames. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a4cd91821a30270d51c4c66594b9d7122aa0cb17278ea70e7e327de30aad32e0a0"></a><!-- doxytag: member="START_RECEIVE" ref="a4cd91821a30270d51c4c66594b9d7122aa0cb17278ea70e7e327de30aad32e0a0" args="" -->START_RECEIVE</em>&nbsp;</td><td>
<p>Start of actual receiving process of the AirFrame. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a4cd91821a30270d51c4c66594b9d7122a2900d4f5f03ec09b83e5c24744924755"></a><!-- doxytag: member="RECEIVING" ref="a4cd91821a30270d51c4c66594b9d7122a2900d4f5f03ec09b83e5c24744924755" args="" -->RECEIVING</em>&nbsp;</td><td>
<p>AirFrame is being received. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a4cd91821a30270d51c4c66594b9d7122a8c8f8a59dc873e035f19750598ceb157"></a><!-- doxytag: member="END_RECEIVE" ref="a4cd91821a30270d51c4c66594b9d7122a8c8f8a59dc873e035f19750598ceb157" args="" -->END_RECEIVE</em>&nbsp;</td><td>
<p>Receiving process over. </p>
</td></tr>
</table>
</dd>
</dl>
<div class="fragment"><pre class="fragment">                       {
    <a class="code" href="a00029.html#a4cd91821a30270d51c4c66594b9d7122aa0cb17278ea70e7e327de30aad32e0a0" title="Start of actual receiving process of the AirFrame.">START_RECEIVE</a> = 1,
    <a class="code" href="a00029.html#a4cd91821a30270d51c4c66594b9d7122a2900d4f5f03ec09b83e5c24744924755" title="AirFrame is being received.">RECEIVING</a>,
    <a class="code" href="a00029.html#a4cd91821a30270d51c4c66594b9d7122a8c8f8a59dc873e035f19750598ceb157" title="Receiving process over.">END_RECEIVE</a>
  };
</pre></div>
</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a0fc69907490ed2752d2a888ef26348ff"></a><!-- doxytag: member="BasePhyLayer::~BasePhyLayer" ref="a0fc69907490ed2752d2a888ef26348ff" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BasePhyLayer::~BasePhyLayer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Free the pointer to the decider and the AnalogueModels and the Radio. </p>

<p>References <a class="el" href="a00029.html#abc00fc5777ef641f72b5a4d85bf65c93">analogueModels</a>, <a class="el" href="a00029.html#a38d35bc99079eff49deb6c870b1175e7">channelInfo</a>, <a class="el" href="a00029.html#a5be00b3a133596d8ed78a9f8e38973d4">decider</a>, <a class="el" href="a00043.html#acb7f1f51f0f75b15fd29379e87128b27">ChannelInfo::getAirFrames()</a>, <a class="el" href="a00141.html#a6adb7b66381adb5e7914e79c94fda6fe">MiximRadio::getAnalogueModel()</a>, <a class="el" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c">radio</a>, <a class="el" href="a00029.html#ac28de586b21162c377a180233299a1d5">radioSwitchingOverTimer</a>, <a class="el" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756">thermalNoise</a>, and <a class="el" href="a00029.html#a2ce22bc20ab469e99352958face5468d">txOverTimer</a>.</p>
<div class="fragment"><pre class="fragment">                            {
  <span class="comment">//get AirFrames from ChannelInfo and delete</span>
  <span class="comment">//(although ChannelInfo normally owns the AirFrames it</span>
  <span class="comment">//is not able to cancel and delete them itself</span>
  <a class="code" href="a00079.html#a13e15d0d80017e55821963b3b4a6cf55" title="Type for container of AirFrames.">AirFrameVector</a> channel;
  <a class="code" href="a00029.html#a38d35bc99079eff49deb6c870b1175e7" title="Channel info keeps track of received AirFrames and provides information about currently active AirFra...">channelInfo</a>.<a class="code" href="a00043.html#acb7f1f51f0f75b15fd29379e87128b27" title="Fills the passed AirFrameVector reference with the AirFrames which intersect with the given time inte...">getAirFrames</a>(0, simTime(), channel);

  <span class="keywordflow">for</span>(AirFrameVector::iterator it = channel.begin();
    it != channel.end(); ++it)
  {
    cancelAndDelete(*it);
  }

  <span class="comment">//free timer messages</span>
  <span class="keywordflow">if</span>(<a class="code" href="a00029.html#a2ce22bc20ab469e99352958face5468d" title="Self message scheduled to the point in time when the transmission of an AirFrame is over...">txOverTimer</a>) {
    cancelAndDelete(<a class="code" href="a00029.html#a2ce22bc20ab469e99352958face5468d" title="Self message scheduled to the point in time when the transmission of an AirFrame is over...">txOverTimer</a>);
  }
  <span class="keywordflow">if</span>(<a class="code" href="a00029.html#ac28de586b21162c377a180233299a1d5" title="Self message scheduled to the point in time when the switching process of the radio is over...">radioSwitchingOverTimer</a>) {
    cancelAndDelete(<a class="code" href="a00029.html#ac28de586b21162c377a180233299a1d5" title="Self message scheduled to the point in time when the switching process of the radio is over...">radioSwitchingOverTimer</a>);
  }

  <span class="comment">//free thermal noise mapping</span>
  <span class="keywordflow">if</span>(<a class="code" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756" title="Defines the strength of the thermal noise.">thermalNoise</a>) {
    <span class="keyword">delete</span> <a class="code" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756" title="Defines the strength of the thermal noise.">thermalNoise</a>;
  }

  <span class="comment">//free Decider</span>
  <span class="keywordflow">if</span>(<a class="code" href="a00029.html#a5be00b3a133596d8ed78a9f8e38973d4" title="Pointer to the decider module.">decider</a> != 0) {
    <span class="keyword">delete</span> <a class="code" href="a00029.html#a5be00b3a133596d8ed78a9f8e38973d4" title="Pointer to the decider module.">decider</a>;
  }

  <span class="comment">/*</span>
<span class="comment">   * get a pointer to the radios RSAM again to avoid deleting it,</span>
<span class="comment">   * it is not created by calling new (BasePhyLayer is not the owner)!</span>
<span class="comment">   */</span>
  <a class="code" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a>* rsamPointer = <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a> ? <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>-&gt;<a class="code" href="a00141.html#a6adb7b66381adb5e7914e79c94fda6fe" title="Returns a pointer to the RadioStateAnalogueModel.">getAnalogueModel</a>() : NULL;

  <span class="comment">//free AnalogueModels</span>
  <span class="keywordflow">for</span>(AnalogueModelList::const_iterator it = <a class="code" href="a00029.html#abc00fc5777ef641f72b5a4d85bf65c93" title="List of the analogue models to use.">analogueModels</a>.begin();
    it != <a class="code" href="a00029.html#abc00fc5777ef641f72b5a4d85bf65c93" title="List of the analogue models to use.">analogueModels</a>.end(); ++it) {

    AnalogueModelList::value_type tmp = *it;

    <span class="comment">// do not delete the RSAM, it&#39;s not allocated by new!</span>
    <span class="keywordflow">if</span> (tmp == rsamPointer) {
      rsamPointer = 0;
      <span class="keywordflow">continue</span>;
    }

    <span class="keywordflow">if</span>(tmp != 0) {
      <span class="keyword">delete</span> tmp;
    }
  }


  <span class="comment">// free radio</span>
  <span class="keywordflow">if</span>(<a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a> != 0) {
    <span class="keyword">delete</span> <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>;
  }
}
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa4c75db0828cf579907b1e9a9c683e99"></a><!-- doxytag: member="BasePhyLayer::cancelScheduledMessage" ref="aa4c75db0828cf579907b1e9a9c683e99" args="(cMessage *msg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BasePhyLayer::cancelScheduledMessage </td>
          <td>(</td>
          <td class="paramtype">cMessage *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tells the <a class="el" href="a00173.html" title="Provides initialisation for several AnalogueModels and Deciders from modules directory.">PhyLayer</a> to cancel a scheduled message (AirFrame or ControlMessage). </p>
<p>Used by the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> if it doesn't need to handle an AirFrame or ControlMessage again anymore. </p>

<p>Implements <a class="el" href="a00079.html#af85151048dba05ec27e378000fd95403">DeciderToPhyInterface</a>.</p>

<p>Referenced by <a class="el" href="a00029.html#ac012473c1be0df5df5f901ad1a3e890e">rescheduleMessage()</a>.</p>
<div class="fragment"><pre class="fragment">                                                       {
  <span class="keywordflow">if</span>(msg-&gt;isScheduled()){
    cancelEvent(msg);
  } <span class="keywordflow">else</span> {
    EV &lt;&lt; <span class="stringliteral">&quot;Warning: Decider wanted to cancel a scheduled message but message&quot;</span>
       &lt;&lt; <span class="stringliteral">&quot; wasn&#39;t actually scheduled. Message is: &quot;</span> &lt;&lt; msg &lt;&lt; endl;
  }
}
</pre></div>
</div>
</div>
<a class="anchor" id="a1e4dd47185d6931380f459c62200faee"></a><!-- doxytag: member="BasePhyLayer::createAnalogueModel" ref="a1e4dd47185d6931380f459c62200faee" args="(const ParameterMap &amp;params) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class _AMODEL_CLASS_ &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_AMODEL_CLASS_* BasePhyLayer::createAnalogueModel </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;&#160;</td>
          <td class="paramname"><em>params</em></td><td>)</td>
          <td> const<code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates and returns an instance of the analogue model with the specified _AMODEL_CLASS_. </p>
<p>The returned <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> has to be generated with the "new" command.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Instance of the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> with the specified class type. </dd></dl>
<div class="fragment"><pre class="fragment">                                                                        {
    _AMODEL_CLASS_ *<span class="keyword">const</span> pAnalogueModel = <span class="keyword">new</span> _AMODEL_CLASS_();
    <span class="keywordflow">if</span> (pAnalogueModel != NULL &amp;&amp; !pAnalogueModel-&gt;initFromMap(params)) {
      opp_warning(<span class="stringliteral">&quot;Analog model from config.xml could not be initialized correctly!&quot;</span>);
    }
    <span class="keywordflow">return</span> pAnalogueModel;
  }
</pre></div>
</div>
</div>
<a class="anchor" id="a5aa60c2caec2dad44aca154e0710a7e4"></a><!-- doxytag: member="BasePhyLayer::createDecider" ref="a5aa60c2caec2dad44aca154e0710a7e4" args="(const ParameterMap &amp;params)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class _DECIDER_CLASS_ &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_DECIDER_CLASS_* BasePhyLayer::createDecider </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;&#160;</td>
          <td class="paramname"><em>params</em></td><td>)</td>
          <td><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates and returns an instance of the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> with the specified _DECIDER_CLASS_. </p>
<p>The returned <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> has to be generated with the "new" command.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Instance of the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> with the specified class type. </dd></dl>

<p>References <a class="el" href="a00027.html#aabf0226159b22b46e70031fd3bb3b1b2">BaseModule::findHost()</a>.</p>
<div class="fragment"><pre class="fragment">                                                             {
    _DECIDER_CLASS_ *<span class="keyword">const</span> pDecider = <span class="keyword">new</span> _DECIDER_CLASS_(<span class="keyword">this</span>, <a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a>, <a class="code" href="a00027.html#aabf0226159b22b46e70031fd3bb3b1b2" title="Function to get a pointer to the host module.">findHost</a>()-&gt;getIndex(), <a class="code" href="a00053.html#a855d05134eb8b4b136aac71480d7a842" title="debug this core module?">coreDebug</a>);
    <span class="keywordflow">if</span> (pDecider != NULL &amp;&amp; !pDecider-&gt;initFromMap(params)) {
      opp_warning(<span class="stringliteral">&quot;Decider from config.xml could not be initialized correctly!&quot;</span>);
    }
    <span class="keywordflow">return</span> pDecider;
  }
</pre></div>
</div>
</div>
<a class="anchor" id="aadce19c8b5e2737ab4fb0d53184ccecf"></a><!-- doxytag: member="BasePhyLayer::filterSignal" ref="aadce19c8b5e2737ab4fb0d53184ccecf" args="(airframe_ptr_t frame)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BasePhyLayer::filterSignal </td>
          <td>(</td>
          <td class="paramtype">airframe_ptr_t&#160;</td>
          <td class="paramname"><em>frame</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Filters the passed AirFrame's <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a> by every registered <a class="el" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a>. </p>
<p>claim the Move pattern of the sender from the <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a> </p>

<p>References <a class="el" href="a00029.html#abc00fc5777ef641f72b5a4d85bf65c93">analogueModels</a>, and <a class="el" href="a00053.html#a4cb3ab0227b20e7c783416a888daaa02">ConnectionManagerAccess::getMobilityModule()</a>.</p>

<p>Referenced by <a class="el" href="a00029.html#af21aac7c5a0c4bc282817232f3879611">handleAirFrameStartReceive()</a>.</p>
<div class="fragment"><pre class="fragment">                                                    {
  <span class="keywordflow">if</span> (<a class="code" href="a00029.html#abc00fc5777ef641f72b5a4d85bf65c93" title="List of the analogue models to use.">analogueModels</a>.empty())
    <span class="keywordflow">return</span>;

  <a class="code" href="a00053.html" title="Basic class for all physical layers, please don&#39;t touch!!">ConnectionManagerAccess</a> *<span class="keyword">const</span> senderModule   = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="a00053.html" title="Basic class for all physical layers, please don&#39;t touch!!">ConnectionManagerAccess</a> *const<span class="keyword">&gt;</span>(frame-&gt;getSenderModule());
  <a class="code" href="a00053.html" title="Basic class for all physical layers, please don&#39;t touch!!">ConnectionManagerAccess</a> *<span class="keyword">const</span> receiverModule = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="a00053.html" title="Basic class for all physical layers, please don&#39;t touch!!">ConnectionManagerAccess</a> *const<span class="keyword">&gt;</span>(frame-&gt;getArrivalModule());
  <span class="comment">//const simtime_t      sStart         = frame-&gt;getSignal().getReceptionStart();</span>

  assert(senderModule); assert(receiverModule);

  ChannelMobilityPtrType sendersMobility  = senderModule   ? senderModule-&gt;<a class="code" href="a00053.html#a4cb3ab0227b20e7c783416a888daaa02" title="Returns the host&#39;s mobility module.">getMobilityModule</a>()   : NULL;
  ChannelMobilityPtrType receiverMobility = receiverModule ? receiverModule-&gt;<a class="code" href="a00053.html#a4cb3ab0227b20e7c783416a888daaa02" title="Returns the host&#39;s mobility module.">getMobilityModule</a>() : NULL;

  <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a> sendersPos  = sendersMobility  ? sendersMobility-&gt;getCurrentPosition(<span class="comment">/*sStart*/</span>) : NoMobiltyPos;
  <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a> receiverPos = receiverMobility ? receiverMobility-&gt;getCurrentPosition(<span class="comment">/*sStart*/</span>): NoMobiltyPos;

  <span class="keywordflow">for</span>(AnalogueModelList::const_iterator it = <a class="code" href="a00029.html#abc00fc5777ef641f72b5a4d85bf65c93" title="List of the analogue models to use.">analogueModels</a>.begin(); it != <a class="code" href="a00029.html#abc00fc5777ef641f72b5a4d85bf65c93" title="List of the analogue models to use.">analogueModels</a>.end(); ++it)
    (*it)-&gt;filterSignal(frame, sendersPos, receiverPos);
}
</pre></div>
</div>
</div>
<a class="anchor" id="aa1de743a3d3ba652c1f3b84b34585743"></a><!-- doxytag: member="BasePhyLayer::finishRadioSwitching" ref="aa1de743a3d3ba652c1f3b84b34585743" args="(bool bSendCtrlMsg=true)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BasePhyLayer::finishRadioSwitching </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>bSendCtrlMsg</em> = <code>true</code></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called the moment the simulated switching process of the <a class="el" href="a00141.html" title="The class that represents the Radio as a state machine.">MiximRadio</a> is finished. </p>
<p>The Radio is set the new RadioState and the MAC Layer is sent a confirmation message.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">bSendCtrlMsg</td><td>Flag for sending control message to MAC (in case of zero switch time this flag maybe false). </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented in <a class="el" href="a00174.html#a52320947de4dccb844bf26a18534fcf3">PhyLayerBattery</a>.</p>

<p>References <a class="el" href="a00141.html#ae9820653aa09c297148210c1de27a2e1">MiximRadio::endSwitch()</a>, <a class="el" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c">radio</a>, <a class="el" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52a876c7366bd2bcb675b41e60007831d06">MacToPhyInterface::RADIO_SWITCHING_OVER</a>, and <a class="el" href="a00029.html#a76d0386516d18d1cc64af5ef6fb315cd">sendControlMsgToMac()</a>.</p>

<p>Referenced by <a class="el" href="a00029.html#a17088ad93f59e143ff6c7ba866a31982">handleSelfMessage()</a>, and <a class="el" href="a00029.html#a5170b3aadae25dc6b9e61974076be04b">setRadioState()</a>.</p>
<div class="fragment"><pre class="fragment">{
  <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>-&gt;<a class="code" href="a00141.html#ae9820653aa09c297148210c1de27a2e1" title="called by PhyLayer when duration-time for the current switching process is up">endSwitch</a>(simTime());
  <span class="keywordflow">if</span> (bSendCtrlMsg) {
      <a class="code" href="a00029.html#a76d0386516d18d1cc64af5ef6fb315cd" title="Called by the Decider to send a control message to the MACLayer.">sendControlMsgToMac</a>(<span class="keyword">new</span> cMessage(<span class="stringliteral">&quot;Radio switching over&quot;</span>, <a class="code" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52a876c7366bd2bcb675b41e60007831d06" title="Indicates the end of a radio switch.">RADIO_SWITCHING_OVER</a>));
  }
}
</pre></div>
</div>
</div>
<a class="anchor" id="af578e3fbeacc12b639dd5f072215bac5"></a><!-- doxytag: member="BasePhyLayer::getAnalogueModelFromName" ref="af578e3fbeacc12b639dd5f072215bac5" args="(const std::string &amp;name, ParameterMap &amp;params) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00009.html">AnalogueModel</a> * BasePhyLayer::getAnalogueModelFromName </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;&#160;</td>
          <td class="paramname"><em>params</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates and returns an instance of the <a class="el" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a> with the specified name. </p>
<p>The returned <a class="el" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a> has to be generated with the "new" command. The <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> keeps the ownership of the returned <a class="el" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a>.</p>
<p>This method is used by the <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> during initialization to load the AnalogueModels which has been specified in the ned file.</p>
<p>This method has to be overridden if you want to be able to load your own AnalogueModels.</p>
<p>Is able to initialize the following AnalogueModels:</p>
<ul>
<li><a class="el" href="a00182.html" title="This special AnalogueModel provides filtering of a Signal according to the actual RadioStates the Rad...">RadioStateAnalogueModel</a> </li>
</ul>

<p>Reimplemented in <a class="el" href="a00175.html#ac31e9a6af36256890a441c812643c15d">PhyLayerUWBIR</a>, <a class="el" href="a00173.html#aaecc372ab08295d393581440b326922f">PhyLayer</a>, and <a class="el" href="a00190.html#a4a7e75e458a9e9ea62bd933378baa7d7">SamplePhyLayer</a>.</p>

<p>References <a class="el" href="a00141.html#a6adb7b66381adb5e7914e79c94fda6fe">MiximRadio::getAnalogueModel()</a>, and <a class="el" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c">radio</a>.</p>

<p>Referenced by <a class="el" href="a00029.html#a8ea7353793eed2f1a7b0cd1caacd72e9">initializeAnalogueModels()</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                                  {

  <span class="comment">// add default analogue models here</span>

  <span class="comment">// case &quot;RSAM&quot;, pointer is valid as long as the radio exists</span>
  <span class="keywordflow">if</span> (name == <span class="stringliteral">&quot;RadioStateAnalogueModel&quot;</span>) {
    <span class="keywordflow">return</span> <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>-&gt;<a class="code" href="a00141.html#a6adb7b66381adb5e7914e79c94fda6fe" title="Returns a pointer to the RadioStateAnalogueModel.">getAnalogueModel</a>();
  }

  <span class="keywordflow">return</span> NULL;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a8cc235ebda1b8ff6dcf17b6b0b91fc13"></a><!-- doxytag: member="BasePhyLayer::getChannelState" ref="a8cc235ebda1b8ff6dcf17b6b0b91fc13" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00044.html">ChannelState</a> BasePhyLayer::getChannelState </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the current state of the channel. </p>
<p>See <a class="el" href="a00044.html" title="Provides information about the current state of the channel:">ChannelState</a> for details. </p>

<p>Implements <a class="el" href="a00134.html#affa30a25b96ffe387b22c68ca35f77a5">MacToPhyInterface</a>.</p>

<p>References <a class="el" href="a00029.html#a5be00b3a133596d8ed78a9f8e38973d4">decider</a>, and <a class="el" href="a00070.html#aa9f0dcd955639fa2c16233f4654a82bc">Decider::getChannelState()</a>.</p>
<div class="fragment"><pre class="fragment">                                                 {
  Enter_Method_Silent();
  assert(<a class="code" href="a00029.html#a5be00b3a133596d8ed78a9f8e38973d4" title="Pointer to the decider module.">decider</a>);
  <span class="keywordflow">return</span> <a class="code" href="a00029.html#a5be00b3a133596d8ed78a9f8e38973d4" title="Pointer to the decider module.">decider</a>-&gt;<a class="code" href="a00070.html#aa9f0dcd955639fa2c16233f4654a82bc" title="A function that returns information about the channel state.">getChannelState</a>();
}
</pre></div>
</div>
</div>
<a class="anchor" id="a7d18a0853db85eba39f370e51ae8b007"></a><!-- doxytag: member="BasePhyLayer::getDeciderFromName" ref="a7d18a0853db85eba39f370e51ae8b007" args="(const std::string &amp;name, ParameterMap &amp;params)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00070.html">Decider</a> * BasePhyLayer::getDeciderFromName </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;&#160;</td>
          <td class="paramname"><em>params</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates and returns an instance of the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> with the specified name. </p>
<p>The returned <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> has to be generated with the "new" command. The <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> keeps the ownership of the returned <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a>.</p>
<p>This method is used by the <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> during Initialization to load the decider which has been specified in the config.xml file.</p>
<p>This method has to be overridden if you want to be able to load your own decider.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Instance of the decider with the specified name. </dd></dl>

<p>Reimplemented in <a class="el" href="a00175.html#a2ee15cb7866f9a8bcb2f7427229d409a">PhyLayerUWBIR</a>, <a class="el" href="a00174.html#a9e0540a943e06cb9d7ccc80853c40986">PhyLayerBattery</a>, <a class="el" href="a00173.html#a6f0907cd759351336c159c6e222beceb">PhyLayer</a>, and <a class="el" href="a00190.html#ad2c09c9853706c2949e06dd9e4fb0739">SamplePhyLayer</a>.</p>

<p>Referenced by <a class="el" href="a00029.html#a9da4f8ffaa373a0de7895cbea524816b">initializeDecider()</a>.</p>
<div class="fragment"><pre class="fragment">{
  <span class="keywordflow">return</span> NULL;
}
</pre></div>
</div>
</div>
<a class="anchor" id="acb8478eaf566b68e949e6d16cea0e22a"></a><!-- doxytag: member="BasePhyLayer::getPhyHeaderLength" ref="acb8478eaf566b68e949e6d16cea0e22a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long BasePhyLayer::getPhyHeaderLength </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the length of the phy header in bits. </p>
<p>Both the MAC and the PHY needs the header length. </p>

<p>Implements <a class="el" href="a00079.html#a7579990df34650e82125a1b91105ae15">DeciderToPhyInterface</a>.</p>

<p>References <a class="el" href="a00029.html#a75255fe80f09f87b7db213d21db3b8e8">headerLength</a>.</p>
<div class="fragment"><pre class="fragment">                                            {
  Enter_Method_Silent();
  <span class="keywordflow">if</span> (<a class="code" href="a00029.html#a75255fe80f09f87b7db213d21db3b8e8" title="Stores the length of the phy header in bits.">headerLength</a> &lt; 0)
    <span class="keywordflow">return</span> par(<span class="stringliteral">&quot;headerLength&quot;</span>).longValue();
  <span class="keywordflow">return</span> <a class="code" href="a00029.html#a75255fe80f09f87b7db213d21db3b8e8" title="Stores the length of the phy header in bits.">headerLength</a>;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a893db61c894236b50c4c56e569ceedbb"></a><!-- doxytag: member="BasePhyLayer::getRadioState" ref="a893db61c894236b50c4c56e569ceedbb" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int BasePhyLayer::getRadioState </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the current state the radio is in. </p>
<p>See RadioState for possible values.</p>
<p>This method is mainly used by the mac layer. </p>

<p>Implements <a class="el" href="a00134.html#a00dd43576b4da205117d53bd3baadc71">MacToPhyInterface</a>.</p>

<p>References <a class="el" href="a00141.html#a234ab13c02b2b3ca369f9b18aace0e44">MiximRadio::getCurrentState()</a>, and <a class="el" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c">radio</a>.</p>

<p>Referenced by <a class="el" href="a00175.html#a6f49c650fc97f95f8a5835a6e88a7f36">PhyLayerUWBIR::isRadioInRX()</a>, <a class="el" href="a00029.html#a36f7f3be7d32aa1818c0f31057478e80">isRadioInRX()</a>, and <a class="el" href="a00080.html#abe90eb371a8c63e71b6e550c93994b75">DeciderUWBIRED::processSignalHeader()</a>.</p>
<div class="fragment"><pre class="fragment">                                      {
  Enter_Method_Silent();
  assert(<a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>);
  <span class="keywordflow">return</span> <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>-&gt;<a class="code" href="a00141.html#a234ab13c02b2b3ca369f9b18aace0e44" title="Returns the state the Radio is currently in.">getCurrentState</a>();
}
</pre></div>
</div>
</div>
<a class="anchor" id="a42664d512b88bedf58b5d21adc180984"></a><!-- doxytag: member="BasePhyLayer::getThermalNoise" ref="a42664d512b88bedf58b5d21adc180984" args="(simtime_t_cref from, simtime_t_cref to)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00058.html">ConstMapping</a> * BasePhyLayer::getThermalNoise </td>
          <td>(</td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>to</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a <a class="el" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a> which defines the thermal noise in the passed time frame (in mW). </p>
<p>The implementing class of this method keeps ownership of the <a class="el" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a>.</p>
<p>This implementation returns a constant mapping with the value of the "thermalNoise" module parameter</p>
<p>Override this method if you want to define a more complex thermal noise. </p>

<p>Implements <a class="el" href="a00079.html#a2c55926187883df5bc322c947d317534">DeciderToPhyInterface</a>.</p>

<p>References <a class="el" href="a00194.html#a17d3c5e8c98e7451a844d59c95c7272a">SimpleConstMapping::initializeArguments()</a>, and <a class="el" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756">thermalNoise</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                 {
  <span class="keywordflow">if</span>(<a class="code" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756" title="Defines the strength of the thermal noise.">thermalNoise</a>)
    <a class="code" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756" title="Defines the strength of the thermal noise.">thermalNoise</a>-&gt;<a class="code" href="a00194.html#a17d3c5e8c98e7451a844d59c95c7272a" title="Initializes the key entry set with the passed position as entry.">initializeArguments</a>(<a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a>(from));

  <span class="keywordflow">return</span> <a class="code" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756" title="Defines the strength of the thermal noise.">thermalNoise</a>;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a3880154c8db8b8efb5315cb6ef8f6c41"></a><!-- doxytag: member="BasePhyLayer::handleMessage" ref="a3880154c8db8b8efb5315cb6ef8f6c41" args="(cMessage *msg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BasePhyLayer::handleMessage </td>
          <td>(</td>
          <td class="paramtype">cMessage *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>OMNeT++ handle message function. </p>
<p>Classify and forward message to subroutines.</p>
<ul>
<li>AirFrames from channel</li>
<li>self scheduled AirFrames</li>
<li>MacPackets from MAC layer</li>
<li>ControllMesasges from MAC layer</li>
<li>self messages like TX_OVER and RADIO_SWITCHED </li>
</ul>

<p>Reimplemented in <a class="el" href="a00190.html#aea91987fbece2dea329cf0a24dfa5450">SamplePhyLayer</a>.</p>

<p>References <a class="el" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52a96eafe94b4f472727793a10013af7671">MacToPhyInterface::AIR_FRAME</a>, <a class="el" href="a00029.html#ac8e87dac89d0c0daa01a8d430be7e7b6">handleAirFrame()</a>, <a class="el" href="a00029.html#a17088ad93f59e143ff6c7ba866a31982">handleSelfMessage()</a>, <a class="el" href="a00029.html#a4cab267d310b5fd6cefe613fc8dfe71d">handleUpperControlMessage()</a>, <a class="el" href="a00029.html#a17b1d469775962d23835dd5f43a639ac">handleUpperMessage()</a>, <a class="el" href="a00029.html#ab58c7430371f1ba135e0a641d150c1e3">upperControlIn</a>, and <a class="el" href="a00029.html#a49fcd06f6c27aab1d14d13eaecc09f1b">upperLayerIn</a>.</p>
<div class="fragment"><pre class="fragment">                                              {

  <span class="comment">//self messages</span>
  <span class="keywordflow">if</span>(msg-&gt;isSelfMessage()) {
    <a class="code" href="a00029.html#a17088ad93f59e143ff6c7ba866a31982" title="Handles self scheduled messages.">handleSelfMessage</a>(msg);

  <span class="comment">//MacPkts &lt;- MacToPhyControlInfo</span>
  } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(msg-&gt;getArrivalGateId() == <a class="code" href="a00029.html#a49fcd06f6c27aab1d14d13eaecc09f1b" title="The id of the in-data gate from the Mac layer.">upperLayerIn</a>) {
    <a class="code" href="a00029.html#a17b1d469775962d23835dd5f43a639ac" title="Handles messages received from the upper layer through the data gate.">handleUpperMessage</a>(msg);

  <span class="comment">//controlmessages</span>
  } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(msg-&gt;getArrivalGateId() == <a class="code" href="a00029.html#ab58c7430371f1ba135e0a641d150c1e3" title="The id of the in-control gate from the Mac layer.">upperControlIn</a>) {
    <a class="code" href="a00029.html#a4cab267d310b5fd6cefe613fc8dfe71d" title="Handles messages received from the upper layer through the control gate.">handleUpperControlMessage</a>(msg);

  <span class="comment">//AirFrames</span>
  } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(msg-&gt;getKind() == <a class="code" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52a96eafe94b4f472727793a10013af7671" title="AirFrame kind.">AIR_FRAME</a>){
    <a class="code" href="a00029.html#ac8e87dac89d0c0daa01a8d430be7e7b6" title="Handles messages received from the channel (probably AirFrames).">handleAirFrame</a>(static_cast&lt;airframe_ptr_t&gt;(msg));

  <span class="comment">//unknown message</span>
  } <span class="keywordflow">else</span> {
    ev &lt;&lt; <span class="stringliteral">&quot;Unknown message received.&quot;</span> &lt;&lt; endl;
    <span class="keyword">delete</span> msg;
  }
}
</pre></div>
</div>
</div>
<a class="anchor" id="a08704deaf03b73c8eda67cc60e670853"></a><!-- doxytag: member="BasePhyLayer::initialize" ref="a08704deaf03b73c8eda67cc60e670853" args="(int stage)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BasePhyLayer::initialize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stage</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>OMNeT++ initialization function. </p>
<p>Read simple parameters. Read and parse xml file for decider and analogue models configuration. </p>

<p>Reimplemented from <a class="el" href="a00053.html#aad16a20e89c1415737abbebd2d2e4383">ConnectionManagerAccess</a>.</p>

<p>Reimplemented in <a class="el" href="a00175.html#a0bb0cfac6ebb5459b7480bf9df337a3f">PhyLayerUWBIR</a>, <a class="el" href="a00174.html#a815f95ad9fe89412ff3c5991ec1cfafe">PhyLayerBattery</a>, and <a class="el" href="a00190.html#a51d4997ab7973ee4b174ae49fb9b658f">SamplePhyLayer</a>.</p>

<p>References <a class="el" href="a00053.html#a5a093670c3f1b4f28f3dfbe064616b1b">ConnectionManagerAccess::cc</a>, <a class="el" href="a00095.html#af308407856d9835b103f2421e373ee28">FWMath::dBm2mW()</a>, <a class="el" href="a00029.html#a75255fe80f09f87b7db213d21db3b8e8">headerLength</a>, <a class="el" href="a00029.html#a8ea7353793eed2f1a7b0cd1caacd72e9">initializeAnalogueModels()</a>, <a class="el" href="a00029.html#a9da4f8ffaa373a0de7895cbea524816b">initializeDecider()</a>, <a class="el" href="a00029.html#aad75440994998cc89ef7028528197cb7">initializeRadio()</a>, <a class="el" href="a00029.html#a80fe7028b2fbf92f61dd30b79e30a86d">maxTXPower</a>, <a class="el" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c">radio</a>, <a class="el" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52a876c7366bd2bcb675b41e60007831d06">MacToPhyInterface::RADIO_SWITCHING_OVER</a>, <a class="el" href="a00029.html#ac28de586b21162c377a180233299a1d5">radioSwitchingOverTimer</a>, <a class="el" href="a00029.html#a71f6c8e91a8f597a5d213b30c64b0cf8">recordStats</a>, <a class="el" href="a00029.html#a7eaa041636b623066b5abd87a38afa25">sensitivity</a>, <a class="el" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756">thermalNoise</a>, <a class="el" href="a00086.html#abf3b99a319deca6efc123ec52d77d867">DimensionSet::timeDomain</a>, <a class="el" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52ab00e54021af4a33a84ac61a7543c7528">MacToPhyInterface::TX_OVER</a>, <a class="el" href="a00029.html#a2ce22bc20ab469e99352958face5468d">txOverTimer</a>, <a class="el" href="a00029.html#ab58c7430371f1ba135e0a641d150c1e3">upperControlIn</a>, <a class="el" href="a00029.html#aca9b66970dd836cc696dd0907c58598b">upperControlOut</a>, <a class="el" href="a00029.html#a49fcd06f6c27aab1d14d13eaecc09f1b">upperLayerIn</a>, <a class="el" href="a00029.html#a334fbbb0a1608058c46906ef2c90045f">upperLayerOut</a>, and <a class="el" href="a00029.html#ad1de573273df163a5fc2b8b537c65e23">world</a>.</p>
<div class="fragment"><pre class="fragment">                                       {

  <a class="code" href="a00029.html#a08704deaf03b73c8eda67cc60e670853" title="OMNeT++ initialization function.">ConnectionManagerAccess::initialize</a>(stage);

  <span class="keywordflow">if</span> (stage == 0) {
    <span class="comment">// if using sendDirect, make sure that messages arrive without delay</span>
    gate(<span class="stringliteral">&quot;radioIn&quot;</span>)-&gt;setDeliverOnReceptionStart(<span class="keyword">true</span>);

    <span class="comment">//get gate ids</span>
    <a class="code" href="a00029.html#a49fcd06f6c27aab1d14d13eaecc09f1b" title="The id of the in-data gate from the Mac layer.">upperLayerIn</a> = findGate(<span class="stringliteral">&quot;upperLayerIn&quot;</span>);
    <a class="code" href="a00029.html#a334fbbb0a1608058c46906ef2c90045f" title="The id of the out-data gate to the Mac layer.">upperLayerOut</a> = findGate(<span class="stringliteral">&quot;upperLayerOut&quot;</span>);
    <a class="code" href="a00029.html#aca9b66970dd836cc696dd0907c58598b" title="The id of the out-control gate to the Mac layer.">upperControlOut</a> = findGate(<span class="stringliteral">&quot;upperControlOut&quot;</span>);
    <a class="code" href="a00029.html#ab58c7430371f1ba135e0a641d150c1e3" title="The id of the in-control gate from the Mac layer.">upperControlIn</a> = findGate(<span class="stringliteral">&quot;upperControlIn&quot;</span>);

    <span class="comment">//read simple ned-parameters</span>
    <span class="comment">//  - initialize basic parameters</span>
    <span class="keywordflow">if</span>(par(<span class="stringliteral">&quot;useThermalNoise&quot;</span>).boolValue()) {
      <span class="keywordtype">double</span> thermalNoiseVal = <a class="code" href="a00095.html#af308407856d9835b103f2421e373ee28">FWMath::dBm2mW</a>(par(<span class="stringliteral">&quot;thermalNoise&quot;</span>).doubleValue());
      <a class="code" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756" title="Defines the strength of the thermal noise.">thermalNoise</a> = <span class="keyword">new</span> <a class="code" href="a00055.html" title="Represents a constant mathematical mapping (f(x) = c)">ConstantSimpleConstMapping</a>(<a class="code" href="a00086.html#abf3b99a319deca6efc123ec52d77d867" title="Shortcut to a DimensionSet which only contains time.">DimensionSet::timeDomain</a>,
                              thermalNoiseVal);
    } <span class="keywordflow">else</span> {
      <a class="code" href="a00029.html#afedc2cd6f80601fb040b56256e6cc756" title="Defines the strength of the thermal noise.">thermalNoise</a> = 0;
    }
    <a class="code" href="a00029.html#a75255fe80f09f87b7db213d21db3b8e8" title="Stores the length of the phy header in bits.">headerLength</a> = par(<span class="stringliteral">&quot;headerLength&quot;</span>).longValue();
    <a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a> = par(<span class="stringliteral">&quot;sensitivity&quot;</span>).doubleValue();
    <span class="keywordflow">if</span> (!isFiniteNumber(<a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a>) || <a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a> &lt;= -999999)
        <a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a> = 0; <span class="comment">// disabled</span>
    <span class="keywordflow">else</span>
        <a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a> = <a class="code" href="a00095.html#af308407856d9835b103f2421e373ee28">FWMath::dBm2mW</a>(<a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a>);
    <span class="keywordflow">if</span> (!isFiniteNumber(<a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a>))
        <a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a> = 0; <span class="comment">// disabled</span>
    <a class="code" href="a00029.html#a80fe7028b2fbf92f61dd30b79e30a86d" title="The maximum transmission power a message can be send with.">maxTXPower</a> = par(<span class="stringliteral">&quot;maxTXPower&quot;</span>).doubleValue();

    <a class="code" href="a00029.html#a71f6c8e91a8f597a5d213b30c64b0cf8" title="Stores if tracking of statistics (esp. cOutvectors) is enabled.">recordStats</a> = par(<span class="stringliteral">&quot;recordStats&quot;</span>).boolValue();

    <span class="comment">//  - initialize radio</span>
    <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a> = <a class="code" href="a00029.html#aad75440994998cc89ef7028528197cb7" title="Initializes and returns the radio class to use.">initializeRadio</a>();

    <span class="comment">// get pointer to the world module</span>
    <a class="code" href="a00029.html#ad1de573273df163a5fc2b8b537c65e23" title="Pointer to the World Utility, to obtain some global information.">world</a> = <a class="code" href="a00093.html" title="Provides method templates to find omnet modules.">FindModule&lt;BaseWorldUtility*&gt;::findGlobalModule</a>();
        <span class="keywordflow">if</span> (<a class="code" href="a00029.html#ad1de573273df163a5fc2b8b537c65e23" title="Pointer to the World Utility, to obtain some global information.">world</a> == NULL) {
            opp_error(<span class="stringliteral">&quot;Could not find BaseWorldUtility module&quot;</span>);
        }

        <span class="keywordflow">if</span>(<a class="code" href="a00053.html#a5a093670c3f1b4f28f3dfbe064616b1b" title="Pointer to the PropagationModel module.">cc</a>-&gt;hasPar(<span class="stringliteral">&quot;sat&quot;</span>)
       &amp;&amp; (<a class="code" href="a00029.html#a7eaa041636b623066b5abd87a38afa25" title="The sensitivity describes the minimum strength a signal must have to be received.">sensitivity</a> - <a class="code" href="a00095.html#af308407856d9835b103f2421e373ee28">FWMath::dBm2mW</a>(<a class="code" href="a00053.html#a5a093670c3f1b4f28f3dfbe064616b1b" title="Pointer to the PropagationModel module.">cc</a>-&gt;par(<span class="stringliteral">&quot;sat&quot;</span>).doubleValue())) &lt; -0.000001) {
            opp_error(<span class="stringliteral">&quot;Sensitivity can&#39;t be smaller than the &quot;</span>
            <span class="stringliteral">&quot;signal attenuation threshold (sat) in ConnectionManager. &quot;</span>
            <span class="stringliteral">&quot;Please adjust your omnetpp.ini file accordingly.&quot;</span>);
    }

<span class="comment">//  } else if (stage == 1){</span>
    <span class="comment">//read complex(xml) ned-parameters</span>
    <span class="comment">//  - analogue model parameters</span>
    <a class="code" href="a00029.html#a8ea7353793eed2f1a7b0cd1caacd72e9" title="Initializes the AnalogueModels with the data from the passed XML-config data.">initializeAnalogueModels</a>(par(<span class="stringliteral">&quot;analogueModels&quot;</span>).xmlValue());
    <span class="comment">//  - decider parameters</span>
    <a class="code" href="a00029.html#a9da4f8ffaa373a0de7895cbea524816b" title="Initializes the Decider with the data from the passed XML-config data.">initializeDecider</a>(par(<span class="stringliteral">&quot;decider&quot;</span>).xmlValue());

    <span class="comment">//initialise timer messages</span>
    <a class="code" href="a00029.html#ac28de586b21162c377a180233299a1d5" title="Self message scheduled to the point in time when the switching process of the radio is over...">radioSwitchingOverTimer</a> = <span class="keyword">new</span> cMessage(<span class="stringliteral">&quot;radio switching over&quot;</span>, <a class="code" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52a876c7366bd2bcb675b41e60007831d06" title="Indicates the end of a radio switch.">RADIO_SWITCHING_OVER</a>);
    <a class="code" href="a00029.html#a2ce22bc20ab469e99352958face5468d" title="Self message scheduled to the point in time when the transmission of an AirFrame is over...">txOverTimer</a> = <span class="keyword">new</span> cMessage(<span class="stringliteral">&quot;transmission over&quot;</span>, <a class="code" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52ab00e54021af4a33a84ac61a7543c7528" title="Indicates the end of a send transmission.">TX_OVER</a>);

  }
}
</pre></div>
</div>
</div>
<a class="anchor" id="aad75440994998cc89ef7028528197cb7"></a><!-- doxytag: member="BasePhyLayer::initializeRadio" ref="aad75440994998cc89ef7028528197cb7" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00141.html">MiximRadio</a> * BasePhyLayer::initializeRadio </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initializes and returns the radio class to use. </p>
<p>Can be overridden by sub-classing phy layers to use their own Radio implementations. </p>

<p>Reimplemented in <a class="el" href="a00175.html#ad49116e3360ea2cb22d1c495fb14e800">PhyLayerUWBIR</a>.</p>

<p>References <a class="el" href="a00141.html#af9b90cb1028bad49bbcc2076ff96ec3b">MiximRadio::createNewRadio()</a>, <a class="el" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c">radio</a>, <a class="el" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46">readPar()</a>, <a class="el" href="a00029.html#a71f6c8e91a8f597a5d213b30c64b0cf8">recordStats</a>, <a class="el" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953">MiximRadio::RX</a>, <a class="el" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a">MiximRadio::setSwitchTime()</a>, <a class="el" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7afd684ca0a1c84f153dec831272ccde42">MiximRadio::SLEEP</a>, and <a class="el" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d">MiximRadio::TX</a>.</p>

<p>Referenced by <a class="el" href="a00029.html#a08704deaf03b73c8eda67cc60e670853">initialize()</a>.</p>
<div class="fragment"><pre class="fragment">                                                {
  <span class="keywordtype">int</span>    initialRadioState   = par(<span class="stringliteral">&quot;initialRadioState&quot;</span>).longValue();
  <span class="keywordtype">double</span> radioMinAtt         = par(<span class="stringliteral">&quot;radioMinAtt&quot;</span>).doubleValue();
  <span class="keywordtype">double</span> radioMaxAtt         = par(<span class="stringliteral">&quot;radioMaxAtt&quot;</span>).doubleValue();
  <span class="keywordtype">int</span>    nbRadioChannels     = <a class="code" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46" title="Reads and returns the parameter with the passed name.">readPar</a>(<span class="stringliteral">&quot;nbRadioChannels&quot;</span>,     1);
  <span class="keywordtype">int</span>    initialRadioChannel = <a class="code" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46" title="Reads and returns the parameter with the passed name.">readPar</a>(<span class="stringliteral">&quot;initialRadioChannel&quot;</span>, 0);

  <a class="code" href="a00141.html" title="The class that represents the Radio as a state machine.">MiximRadio</a>* <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a> = <a class="code" href="a00141.html#af9b90cb1028bad49bbcc2076ff96ec3b" title="Creates a new instance of this class.">MiximRadio::createNewRadio</a>(<a class="code" href="a00029.html#a71f6c8e91a8f597a5d213b30c64b0cf8" title="Stores if tracking of statistics (esp. cOutvectors) is enabled.">recordStats</a>, initialRadioState,
                     radioMinAtt, radioMaxAtt,
                     initialRadioChannel, nbRadioChannels);

  <span class="comment">//  - switch times to TX</span>
  <span class="comment">//if no RX to TX defined asume same time as sleep to TX</span>
  radio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953" title="receiving state">MiximRadio::RX</a>, <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d" title="transmitting state">MiximRadio::TX</a>, (hasPar(<span class="stringliteral">&quot;timeRXToTX&quot;</span>) ? par(<span class="stringliteral">&quot;timeRXToTX&quot;</span>) : par(<span class="stringliteral">&quot;timeSleepToTX&quot;</span>)).doubleValue());
  <span class="comment">//if no sleep to TX defined asume same time as RX to TX</span>
  radio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7afd684ca0a1c84f153dec831272ccde42" title="sleeping">MiximRadio::SLEEP</a>, <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d" title="transmitting state">MiximRadio::TX</a>, (hasPar(<span class="stringliteral">&quot;timeSleepToTX&quot;</span>) ? par(<span class="stringliteral">&quot;timeSleepToTX&quot;</span>) : par(<span class="stringliteral">&quot;timeRXToTX&quot;</span>)).doubleValue());

  <span class="comment">//  - switch times to RX</span>
  <span class="comment">//if no TX to RX defined asume same time as sleep to RX</span>
  radio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d" title="transmitting state">MiximRadio::TX</a>, <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953" title="receiving state">MiximRadio::RX</a>, (hasPar(<span class="stringliteral">&quot;timeTXToRX&quot;</span>) ? par(<span class="stringliteral">&quot;timeTXToRX&quot;</span>) : par(<span class="stringliteral">&quot;timeSleepToRX&quot;</span>)).doubleValue());
  <span class="comment">//if no sleep to RX defined asume same time as TX to RX</span>
  radio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7afd684ca0a1c84f153dec831272ccde42" title="sleeping">MiximRadio::SLEEP</a>, <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953" title="receiving state">MiximRadio::RX</a>, (hasPar(<span class="stringliteral">&quot;timeSleepToRX&quot;</span>) ? par(<span class="stringliteral">&quot;timeSleepToRX&quot;</span>) : par(<span class="stringliteral">&quot;timeTXToRX&quot;</span>)).doubleValue());

  <span class="comment">//  - switch times to sleep</span>
  <span class="comment">//if no TX to sleep defined asume same time as RX to sleep</span>
  radio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d" title="transmitting state">MiximRadio::TX</a>, <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7afd684ca0a1c84f153dec831272ccde42" title="sleeping">MiximRadio::SLEEP</a>, (hasPar(<span class="stringliteral">&quot;timeTXToSleep&quot;</span>) ? par(<span class="stringliteral">&quot;timeTXToSleep&quot;</span>) : par(<span class="stringliteral">&quot;timeRXToSleep&quot;</span>)).doubleValue());
  <span class="comment">//if no RX to sleep defined asume same time as TX to sleep</span>
  radio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953" title="receiving state">MiximRadio::RX</a>, <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7afd684ca0a1c84f153dec831272ccde42" title="sleeping">MiximRadio::SLEEP</a>, (hasPar(<span class="stringliteral">&quot;timeRXToSleep&quot;</span>) ? par(<span class="stringliteral">&quot;timeRXToSleep&quot;</span>) : par(<span class="stringliteral">&quot;timeTXToSleep&quot;</span>)).doubleValue());

  <span class="keywordflow">return</span> <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a618479a7b36d43594ab3e8a7d80007bb"></a><!-- doxytag: member="BasePhyLayer::isKnownProtocolId" ref="a618479a7b36d43594ab3e8a7d80007bb" args="(int id) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool BasePhyLayer::isKnownProtocolId </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td> const<code> [inline, protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns true if the protocol with the passed identifier is decodeable by the decider. </p>
<p>If the protocol with the passed id is not understood by this phy layers decider the according AirFrame is not passed to the it but only is added to channel info to be available as interference to the decider.</p>
<p>Default implementation checks only if the passed id is the same as the one returned by "myProtocolId()".</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>The identifier of the protocol of an AirFrame. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns true if the passed protocol id is supported by this phy- layer. </dd></dl>

<p>Referenced by <a class="el" href="a00029.html#af21aac7c5a0c4bc282817232f3879611">handleAirFrameStartReceive()</a>.</p>
<div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <span class="keywordtype">id</span> == <a class="code" href="a00029.html#adecf85d8636ac48e1ce8cea176a3c71c" title="Returns the identifier of the protocol this phy uses to send messages.">myProtocolId</a>(); }
</pre></div>
</div>
</div>
<a class="anchor" id="adecf85d8636ac48e1ce8cea176a3c71c"></a><!-- doxytag: member="BasePhyLayer::myProtocolId" ref="adecf85d8636ac48e1ce8cea176a3c71c" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int BasePhyLayer::myProtocolId </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the identifier of the protocol this phy uses to send messages. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An integer representing the identifier of the used protocol. </dd></dl>

<p>Referenced by <a class="el" href="a00175.html#a580a9a246bc519e8c4f97a5381a8877b">PhyLayerUWBIR::encapsMsg()</a>, and <a class="el" href="a00029.html#a9e03a4078cc2d1c4214249120901321c">encapsMsg()</a>.</p>
<div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> protocolId; }
</pre></div>
</div>
</div>
<a class="anchor" id="acb6faccca49fc7d6f8604ee7f29b4c46"></a><!-- doxytag: member="BasePhyLayer::readPar" ref="acb6faccca49fc7d6f8604ee7f29b4c46" args="(const char *parName, const T defaultValue) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">template double BasePhyLayer::readPar&lt; double &gt; </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>parName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T&#160;</td>
          <td class="paramname"><em>defaultValue</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reads and returns the parameter with the passed name. </p>
<p>If the parameter couldn't be found the value of defaultValue is returned.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">parName</td><td>- the name of the ned-parameter </td></tr>
    <tr><td class="paramname">defaultValue</td><td>- the value to be returned if the parameter couldn't be found </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="a00175.html#ad49116e3360ea2cb22d1c495fb14e800">PhyLayerUWBIR::initializeRadio()</a>, and <a class="el" href="a00029.html#aad75440994998cc89ef7028528197cb7">initializeRadio()</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                         {
  <span class="keywordflow">if</span>(hasPar(parName))
    <span class="keywordflow">return</span> par(parName);
  <span class="keywordflow">return</span> defaultValue;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a4be8fe4abf2c9705625f93114aa6d337"></a><!-- doxytag: member="BasePhyLayer::recordScalar" ref="a4be8fe4abf2c9705625f93114aa6d337" args="(const char *name, double value, const char *unit=NULL)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BasePhyLayer::recordScalar </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>unit</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Records a double into the scalar result file. </p>
<p>Implements the method from <a class="el" href="a00079.html" title="This class is the interface for a Decider to the BasePhyLayer.">DeciderToPhyInterface</a>, method-calls are forwarded to OMNeT-method 'recordScalar'. </p>

<p>Implements <a class="el" href="a00079.html#a9183eb9c635a185f18da631f2d2d9f1c">DeciderToPhyInterface</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                {
  <a class="code" href="a00029.html#a4be8fe4abf2c9705625f93114aa6d337" title="Records a double into the scalar result file.">ConnectionManagerAccess::recordScalar</a>(name, value, unit);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ac012473c1be0df5df5f901ad1a3e890e"></a><!-- doxytag: member="BasePhyLayer::rescheduleMessage" ref="ac012473c1be0df5df5f901ad1a3e890e" args="(cMessage *msg, simtime_t_cref t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BasePhyLayer::rescheduleMessage </td>
          <td>(</td>
          <td class="paramtype">cMessage *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tells the <a class="el" href="a00173.html" title="Provides initialisation for several AnalogueModels and Deciders from modules directory.">PhyLayer</a> to reschedule a message (AirFrame or ControlMessage). </p>
<p>Used by the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> if it has to handle an AirFrame or an control message earlier than it has returned to the <a class="el" href="a00173.html" title="Provides initialisation for several AnalogueModels and Deciders from modules directory.">PhyLayer</a> the last time the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> handled that message. </p>

<p>Implements <a class="el" href="a00079.html#a223fb24be9268abba32e90181fa248b9">DeciderToPhyInterface</a>.</p>

<p>References <a class="el" href="a00029.html#aa4c75db0828cf579907b1e9a9c683e99">cancelScheduledMessage()</a>.</p>
<div class="fragment"><pre class="fragment">                                                                    {
  <a class="code" href="a00029.html#aa4c75db0828cf579907b1e9a9c683e99" title="Tells the PhyLayer to cancel a scheduled message (AirFrame or ControlMessage).">cancelScheduledMessage</a>(msg);
  scheduleAt(t, msg);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a76d0386516d18d1cc64af5ef6fb315cd"></a><!-- doxytag: member="BasePhyLayer::sendControlMsgToMac" ref="a76d0386516d18d1cc64af5ef6fb315cd" args="(cMessage *msg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BasePhyLayer::sendControlMsgToMac </td>
          <td>(</td>
          <td class="paramtype">cMessage *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called by the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> to send a control message to the MACLayer. </p>
<p>This function can be used to answer a ChannelSenseRequest to the MACLayer </p>

<p>Implements <a class="el" href="a00079.html#a319e413b963f03ff218b0d0024fb66b9">DeciderToPhyInterface</a>.</p>

<p>References <a class="el" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52aa6ff58f5815b155504d37339ee5c7222">MacToPhyInterface::CHANNEL_SENSE_REQUEST</a>, <a class="el" href="a00029.html#a38d35bc99079eff49deb6c870b1175e7">channelInfo</a>, <a class="el" href="a00043.html#a5b1b8d56aa2fa64b5d79c0cf5c3167a9">ChannelInfo::isRecording()</a>, <a class="el" href="a00029.html#aaa439e85a8bc20a39477055aecf04993">sendControlMessageUp()</a>, and <a class="el" href="a00043.html#a884277584d1abf73eaca5df0c61e08c9">ChannelInfo::stopRecording()</a>.</p>

<p>Referenced by <a class="el" href="a00029.html#aa1de743a3d3ba652c1f3b84b34585743">finishRadioSwitching()</a>, and <a class="el" href="a00029.html#a17088ad93f59e143ff6c7ba866a31982">handleSelfMessage()</a>.</p>
<div class="fragment"><pre class="fragment">                                                    {
  <span class="keywordflow">if</span>(msg-&gt;getKind() == <a class="code" href="a00134.html#a36bc50a86bf1cc0f9efd374613d61a52aa6ff58f5815b155504d37339ee5c7222" title="Channel sense control message between Mac and Phy.">CHANNEL_SENSE_REQUEST</a>) {
    <span class="keywordflow">if</span>(<a class="code" href="a00029.html#a38d35bc99079eff49deb6c870b1175e7" title="Channel info keeps track of received AirFrames and provides information about currently active AirFra...">channelInfo</a>.<a class="code" href="a00043.html#a5b1b8d56aa2fa64b5d79c0cf5c3167a9" title="Returns true if ChannelInfo is currently recording.">isRecording</a>()) {
      <a class="code" href="a00029.html#a38d35bc99079eff49deb6c870b1175e7" title="Channel info keeps track of received AirFrames and provides information about currently active AirFra...">channelInfo</a>.<a class="code" href="a00043.html#a884277584d1abf73eaca5df0c61e08c9" title="Tells ChannelInfo to stop recording Information from now on.">stopRecording</a>();
    }
  }
  <a class="code" href="a00029.html#aaa439e85a8bc20a39477055aecf04993" title="Sends the passed control message to the upper layer.">sendControlMessageUp</a>(msg);
}
</pre></div>
</div>
</div>
<a class="anchor" id="aa255e2b0181c204d4a8d06075967ef10"></a><!-- doxytag: member="BasePhyLayer::sendUp" ref="aa255e2b0181c204d4a8d06075967ef10" args="(airframe_ptr_t packet, DeciderResult *result)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BasePhyLayer::sendUp </td>
          <td>(</td>
          <td class="paramtype">airframe_ptr_t&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00075.html">DeciderResult</a> *&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called to send an AirFrame with <a class="el" href="a00075.html" title="A class to represent the result of a processed packet (that is not noise) by the Decider.">DeciderResult</a> to the MACLayer. </p>
<p>When a packet is completely received and not noise, the <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a> call this function to send the packet together with the corresponding <a class="el" href="a00075.html" title="A class to represent the result of a processed packet (that is not noise) by the Decider.">DeciderResult</a> up to MACLayer </p>

<p>Implements <a class="el" href="a00079.html#ad81919dcafb2d568303e9ed362dafd93">DeciderToPhyInterface</a>.</p>

<p>References <a class="el" href="a00029.html#af5ac9665c3f3eaee7846ef0ba141b858">sendMacPktUp()</a>, and <a class="el" href="a00029.html#af629dfbac6c68d0310ed91a7520c7ab2">setUpControlInfo()</a>.</p>
<div class="fragment"><pre class="fragment">                                                                     {

  coreEV &lt;&lt; <span class="stringliteral">&quot;Decapsulating MacPacket from Airframe with ID &quot;</span> &lt;&lt; frame-&gt;getId() &lt;&lt; <span class="stringliteral">&quot; and sending it up to MAC.&quot;</span> &lt;&lt; endl;

  cMessage* packet = frame-&gt;decapsulate();

  assert(packet);

  <a class="code" href="a00029.html#af629dfbac6c68d0310ed91a7520c7ab2" title="Attaches a &quot;control info&quot; (PhyToMac) structure (object) to the message pMsg.">setUpControlInfo</a>(packet, result);

  <a class="code" href="a00029.html#af5ac9665c3f3eaee7846ef0ba141b858" title="Sends the passed MacPkt to the upper layer.">sendMacPktUp</a>(packet);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a5170b3aadae25dc6b9e61974076be04b"></a><!-- doxytag: member="BasePhyLayer::setRadioState" ref="a5170b3aadae25dc6b9e61974076be04b" args="(int rs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">simtime_t BasePhyLayer::setRadioState </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rs</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tells the <a class="el" href="a00029.html" title="The BasePhyLayer represents the physical layer of a nic.">BasePhyLayer</a> to switch to the specified radio state. </p>
<p>The switching process can take some time depending on the specified switching times in the ned file.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="a00070.html#a7fbb5a5f14ae118e40d7db1903be6d51" title="simtime that tells the Phy-Layer not to pass an AirFrame again">Decider::notAgain</a>: Error code if the Radio is currently switching else: switching time from the current RadioState to the new RadioState </dd></dl>

<p>Implements <a class="el" href="a00134.html#ad25abbad9aa16bdbf24bf1dd582b1c6f">MacToPhyInterface</a>.</p>

<p>Reimplemented in <a class="el" href="a00175.html#a20ac8e3956abe65f59c69d6dcd54ec1d">PhyLayerUWBIR</a>, and <a class="el" href="a00174.html#ab297612cef7286db7722d19ea3a8924f">PhyLayerBattery</a>.</p>

<p>References <a class="el" href="a00029.html#aa1de743a3d3ba652c1f3b84b34585743">finishRadioSwitching()</a>, <a class="el" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c">radio</a>, <a class="el" href="a00029.html#ac28de586b21162c377a180233299a1d5">radioSwitchingOverTimer</a>, <a class="el" href="a00029.html#aa59aef501cadd36c94d4f82efe9b64be">sendSelfMessage()</a>, <a class="el" href="a00141.html#a1502d8706569eb031bde5c1c29f5bedb">MiximRadio::switchTo()</a>, and <a class="el" href="a00029.html#a2ce22bc20ab469e99352958face5468d">txOverTimer</a>.</p>
<div class="fragment"><pre class="fragment">                                            {
  Enter_Method_Silent();
  assert(<a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>);

  <span class="keywordflow">if</span>(<a class="code" href="a00029.html#a2ce22bc20ab469e99352958face5468d" title="Self message scheduled to the point in time when the transmission of an AirFrame is over...">txOverTimer</a> &amp;&amp; <a class="code" href="a00029.html#a2ce22bc20ab469e99352958face5468d" title="Self message scheduled to the point in time when the transmission of an AirFrame is over...">txOverTimer</a>-&gt;isScheduled()) {
    opp_warning(<span class="stringliteral">&quot;Switched radio while sending an AirFrame. The effects this would have on the transmission are not simulated by the BasePhyLayer!&quot;</span>);
  }

  simtime_t switchTime = <a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>-&gt;<a class="code" href="a00141.html#a1502d8706569eb031bde5c1c29f5bedb" title="A function called by the Physical Layer to start the switching process to a new RadioState.">switchTo</a>(rs, simTime());

  <span class="comment">//invalid switch time, we are probably already switching</span>
  <span class="keywordflow">if</span>(switchTime &lt; SIMTIME_ZERO)
    <span class="keywordflow">return</span> switchTime;

  <span class="comment">// if switching is done in exactly zero-time no extra self-message is scheduled</span>
  <span class="keywordflow">if</span> (switchTime == SIMTIME_ZERO) {
    <span class="comment">// In case of zero-time-switch, send no control-message to MAC!</span>
    <a class="code" href="a00029.html#aa1de743a3d3ba652c1f3b84b34585743" title="Called the moment the simulated switching process of the MiximRadio is finished.">finishRadioSwitching</a>(<span class="keyword">false</span>);
  }
  <span class="keywordflow">else</span> {
    <a class="code" href="a00029.html#aa59aef501cadd36c94d4f82efe9b64be" title="Schedule self message to passed point in time.">sendSelfMessage</a>(<a class="code" href="a00029.html#ac28de586b21162c377a180233299a1d5" title="Self message scheduled to the point in time when the switching process of the radio is over...">radioSwitchingOverTimer</a>, simTime() + switchTime);
  }

  <span class="keywordflow">return</span> switchTime;
}
</pre></div>
</div>
</div>
<a class="anchor" id="af629dfbac6c68d0310ed91a7520c7ab2"></a><!-- doxytag: member="BasePhyLayer::setUpControlInfo" ref="af629dfbac6c68d0310ed91a7520c7ab2" args="(cMessage *const pMsg, DeciderResult *const pDeciderResult)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cObject * BasePhyLayer::setUpControlInfo </td>
          <td>(</td>
          <td class="paramtype">cMessage *const&#160;</td>
          <td class="paramname"><em>pMsg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00075.html">DeciderResult</a> *const&#160;</td>
          <td class="paramname"><em>pDeciderResult</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Attaches a "control info" (PhyToMac) structure (object) to the message pMsg. </p>
<p>This is most useful when passing packets between protocol layers of a protocol stack, the control info will contain the decider result.</p>
<p>The "control info" object will be deleted when the message is deleted. Only one "control info" structure can be attached (the second setL3ToL2ControlInfo() call throws an error).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pMsg</td><td>The message where the "control info" shall be attached. </td></tr>
    <tr><td class="paramname">pSrcAddr</td><td>The MAC address of the message receiver. </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="a00177.html#a7d5a61c8f8a55edd3ea9e7d8195543ef">PhyToMacControlInfo::setControlInfo()</a>.</p>

<p>Referenced by <a class="el" href="a00029.html#aa255e2b0181c204d4a8d06075967ef10">sendUp()</a>.</p>
<div class="fragment"><pre class="fragment">{
  <span class="keywordflow">return</span> <a class="code" href="a00177.html#a7d5a61c8f8a55edd3ea9e7d8195543ef" title="Attaches a &quot;control info&quot; structure (object) to the message pMsg.">PhyToMacControlInfo::setControlInfo</a>(pMsg, pDeciderResult);
}
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="ac68a290868512c992f8a49b6af7b6c7c"></a><!-- doxytag: member="BasePhyLayer::airFramePriority" ref="ac68a290868512c992f8a49b6af7b6c7c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">short <a class="el" href="a00029.html#ac68a290868512c992f8a49b6af7b6c7c">BasePhyLayer::airFramePriority</a> = 10<code> [static, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Defines the scheduling priority of AirFrames. </p>
<p>AirFrames use a slightly higher priority than normal to ensure channel consistency. This means that before anything else happens at a time point t every AirFrame which ended at t has been removed and every AirFrame started at t has been added to the channel.</p>
<p>An example where this matters is a ChannelSenseRequest which ends at the same time as an AirFrame starts (or ends). Depending on which message is handled first the result of ChannelSenseRequest would differ. </p>

<p>Referenced by <a class="el" href="a00175.html#a580a9a246bc519e8c4f97a5381a8877b">PhyLayerUWBIR::encapsMsg()</a>, and <a class="el" href="a00029.html#a9e03a4078cc2d1c4214249120901321c">encapsMsg()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/phyLayer/<a class="el" href="a00285_source.html">BasePhyLayer.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/phyLayer/BasePhyLayer.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00029.html">BasePhyLayer</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:31 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
